package cn.com.util;

import cn.com.db.dto.DiyWorkArg;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.apache.commons.lang.StringUtils;

public class JsonUtil {

    public static String toJsonString(Object o){
        return JSON.toJSONString(o, SerializerFeature.DisableCircularReferenceDetect);
    }

    public static DiyWorkArg parseDiyWorkArg(String diyWorkArg){
        if (StringUtils.isBlank(diyWorkArg)){
            return null;
        }
        return JSON.parseObject(diyWorkArg,DiyWorkArg.class);
    }
}
